home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / biblio / bibtex / utils / bibclean / machdefs.h < prev    next >
C/C++ Source or Header  |  1992-10-06  |  18KB  |  521 lines

  1. /* -*-C-*- machdefs.h */
  2. /*-->machdefs*/
  3. /**********************************************************************/
  4. /****************************** machdefs ******************************/
  5. /**********************************************************************/
  6.  
  7. #ifndef MACHDEFS_H_DEFINED_
  8. #define MACHDEFS_H_DEFINED_
  9.  
  10. /* $Id: machdefs.h,v 1.8 1992/10/08 01:42:01 beebe Exp beebe $
  11.  * $Log: machdefs.h,v $
  12.  * Revision 1.8  1992/10/08  01:42:01  beebe
  13.  * Update for C++.
  14.  *
  15.  * Revision 1.7  1992/07/10  15:50:06  beebe
  16.  * Remove support for Lattice C.
  17.  *
  18.  * Revision 1.6  1992/03/10  14:13:53  beebe
  19.  * *** empty log message ***
  20.  *
  21.  * Revision 1.5  1992/02/29  19:42:20  beebe
  22.  * Update for version 3.0.114 [29-Feb-1992] following two-month
  23.  * major overhaul and compilation testing on numerous machines.
  24.  *
  25.  * Revision 1.5  1992/02/29  19:42:20  beebe
  26.  * Update for version 3.0.114 [29-Feb-1992] following two-month
  27.  * major overhaul and compilation testing on numerous machines.
  28.  *
  29.  * Revision 1.4  1992/01/22  02:37:14  beebe
  30.  * *** empty log message ***
  31.  *
  32.  * Revision 1.3  1992/01/22  02:04:26  beebe
  33.  * Add Revision Control System keyword comments.
  34.  *
  35.  */
  36.  
  37. /***********************************************************************
  38.  
  39. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  40. This file should contain definitions for symbols used for all operating
  41. system / implementation dependencies, and if the driver family has
  42. already been implemented on your machine, this should be the only file
  43. requiring changes.  If you choose to accept the default search paths,
  44. then no changes should be necessary.
  45.  
  46. How to change this file, or the associated osxxx.h files:
  47.     * Check os.h to see if your operating system and C language
  48.       implementation will be recognized automatically.  If so, then
  49.       you may choose to change:
  50.         * the help string: DVIHELP
  51.         * the search path variables: DVIFONTS, DVIINPUTS,
  52.           TEXFONTS, and TEXINPUTS
  53.         * the font file name formats: FONTFMT and TFMFMT
  54.         * the file system map file: FSMAPFILE
  55.         * the TeX-to-PostScript font remapping file: PSMAPFILE
  56.       Note that ALL of these can be set at run-time from the
  57.       environment, the command line, and the startup file, so such
  58.       changes are not mandatory.  DVIFONTS and DVIINPUTS are
  59.       normally empty; if specified, they override TEXFONTS and
  60.       TEXINPUTS (see code in main() following the initglob() call).
  61.  
  62.     * If you are adding support for a new operating system, create a
  63.       new symbol OS_xxx for it in os.h, add a new
  64.       #if OS_xxx ...
  65.       #endif
  66.       section below, and a separate file, osxxx.h, to contain the
  67.       changes.
  68.  
  69.     * If you are adding a new implementation for an existing
  70.       operating system, create a new symbol for it in os.h and add
  71.       appropriate conditionals inside the corresponding osxxx.h
  72.       file.
  73.  
  74.     * If you must replace a standard C library function (usually
  75.       because of bugs in the library version), replace instances of
  76.       its use in the source code with an upper-case equivalent (e.g.
  77.       ungetc --> UNGETC), then define the upper-case name below in
  78.       the generic section, plus the separate operating-system
  79.       specific osxxx.h files.
  80.  
  81.     * ENV_xxx variables names are intentionally chosen below to be
  82.       identical across all architectures, since this reduces
  83.       confusion for users who work in hetergeneous environments.
  84.       Change them only at the risk of confounding users of the
  85.       drivers.
  86.  
  87.     * The following variables can be set by compile-time
  88.       preprocessor variable assignments:
  89.  
  90.         DEV_CANON_II
  91.         DVIFONTS
  92.         DVIINITFILE
  93.         DVIINPUTS
  94.         ENV_DVIFONTS
  95.         ENV_DVIHELP
  96.         ENV_DVIINPUTS
  97.         ENV_FONTFMT
  98.         ENV_FONTMAGS
  99.         ENV_FSMAPFILE
  100.         ENV_PSMAPFILE
  101.         ENV_SPOOLFMT
  102.         ENV_SYSPATH
  103.         ENV_TEXFONTS
  104.         ENV_TEXINPUTS
  105.         ENV_TFMFMT
  106.         FONTFMT
  107.         FSMAPFILE
  108.         PSMAPFILE
  109.         HIRES
  110.         SUBEXT
  111.         SUBNAME
  112.         TEXFONTS
  113.         TEXINPUTS
  114.         TFMFMT
  115.  
  116. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  117.  
  118. List of symbols actually used for #if's [22-Jan-1992]
  119.  
  120. Flags and strings:
  121.     ALLOW_INTERRUPT    -- allow interactive interrupt
  122.     ARITHRSHIFT    -- implementation uses arithmetic (not logical)
  123.                right shift
  124.     BUFSIZE        -- stdio.h default buffer size (osvmcms.h only)
  125.     CACHE_FONTS    -- implement font caching in memory to reduce
  126.                I/O, especially important for networked file
  127.                systems.
  128.     DISKFULL    -- test for stdio errors
  129.     DVIEXT        -- DVI file extension
  130.     DVIFONTS    -- TeX font file path list
  131.     DVIHELP        -- how to find documentation (for usage())
  132.     DVIINITFILE    -- startup file name
  133.     DVIINPUTS    -- directory path list for non-font files
  134.     DVIPREFIX    -- prefix to standard 3-character extension of
  135.                output and log files
  136.     ENV_DVIFONTS    -- environment variable name for DVIFONTS
  137.     ENV_DVIINPUTS    -- environment variable name for DVIINPUTS
  138.     ENV_DVIHELP    -- environment variable name for DVIHELP
  139.     ENV_FONTFMT    -- environment variable name for FONTFMT
  140.     ENV_FONTMAGS    -- environment variable name for FONTMAGS
  141.     ENV_FSMAPFILE    -- environment variable name for FSMAPFILE
  142.     ENV_PSMAPFILE    -- environment variable name for PSMAPFILE
  143.     ENV_SPOOLFMT    -- environment variable name for SPOOLFMT
  144.     ENV_SYSPATH    -- environment variable name for system search
  145.                path
  146.     ENV_TEXFONTS    -- environment variable name for TEXFONTS
  147.     ENV_TEXINPUTS    -- environment variable name for TEXINPUTS
  148.     ENV_TFMFMT    -- environment variable name for TFMFMT
  149.     ERRSUFFIX    -- error file extension
  150.     EXTSEPARATOR    -- string that separates a file name and
  151.                extension
  152.     FILE_BASE    -- macros for memory-mapped font support
  153.     FILE_CNT
  154.     FILE_PTR
  155.     FONTFMT        -- font name format list
  156.     FONTMAGS    -- font magnification list
  157.     FOPEN_        -- name of fopen() or its replacement; UNIX
  158.                <sys/file.h> defines FOPEN, so we add a
  159.                trailing underscore
  160.     FSEEK        -- name of fseek() or its replacement
  161.     FSMAPFILE    -- file system map file
  162.     FTELL        -- name of ftell() or its replacement
  163.     GETENV        -- name of getenv() or its replacement
  164.     HOST_WORD_SIZE    -- host integer word size in bits
  165.     LINT_ARGS    -- select argument type checking (only for IBM
  166.                PC DOS Microsoft C 4.0)
  167.     MALLOC        -- name of malloc() or its replacement
  168.     MAXDRIFT    -- default value for maxdrift option (can be
  169.                changed at run time)
  170.     MAXOPENFONTS    -- limit on number of open font files (can be
  171.                changed at run time)
  172.     OPTION_CHAR    -- command-line option prefix character
  173.                (normally '-')
  174.     PSMAPFILE    -- TeX-to-PostScript font remapping file
  175.     PS_MAXWIDTH    -- approximate line width limit for PostScript
  176.                output
  177.     PS_SHORTLINES    -- shorter output lines in PostScript
  178.     PS_XONXOFFBUG    -- PostScript version 23.0 Xon/Xoff bug
  179.                workaround
  180.     PXLID        -- TeX PXL file ID
  181.     READ        -- name of read() or its replacement
  182.     REWIND        -- name of rewind() or its replacement
  183.     SEGMEM        -- segmented memory (Intel); bitmap is raster
  184.                vector
  185.     SPOOLFMT    -- DVI spool command format
  186.     SUBEXT        -- font substitution file extension
  187.     SUBNAME        -- font substitution file name
  188.     SYSPATH        -- system search path environment variable name
  189.     TEXFONTS    -- TeX font file path list
  190.     TEXINPUTS    -- TeX input file path list
  191.     TFMEXT        -- TFM file extension
  192.     TFMFMT        -- TFM file format
  193.     UNGETC        -- name of ungetc() or its replacement
  194.  
  195. Alternate library routines are supplied on some systems for misfeature
  196. workarounds.
  197.  
  198. Standard C reserves preprocessor symbols beginning with an underscore
  199. followed by an upper-case letter, or another underscore, for
  200. implementation flags, and requires __STDC__ to be non-zero if the
  201. implementation is standard conforming.  Such macros, once defined, are
  202. permanent, and may not be changed by the user.  Not all compilers
  203. enforce this, but GNU gcc does.
  204.  
  205. In pre-Standard C implementations, os.h defines __STDC__ to be zero.
  206. However, because some almost Standard-C-conformant compilers define
  207. __STDC__ as an unchangeable 0, we use a private symbol, STDC, instead.
  208.  
  209. GNU gcc unfortunately defines __STDC__ to be non-zero, but in most
  210. implementations, still only provides a compiler, but neither a run-time
  211. library, nor system header files, which are likely to be written in
  212. pre-Standard C.  We therefore have to jump through a few hoops to deal
  213. with it (gcc's author refuses to fix the error).  The compiler is
  214. excellent, produces code for many different architectures, and is free,
  215. so we put up with this idiosyncrasy.
  216.  
  217.     __STDC__        -- Standard C conformant compiler and
  218.                    library
  219.     __GNUC__        -- GNU C compiler
  220.     __MSDOS__, __TURBOC__    -- Turbo C on PC DOS
  221.     __COMPILER_KCC__    -- SRI's KCC on TOPS-20
  222.     MSDOS, _QC        -- Microsoft C and Quick C
  223.  
  224. Use of these symbols, other than STDC, should be restricted to os.h, and
  225. possibly typedefs.h, xstddef.h, and xstdlib.h.
  226.  
  227. These private symbols for C implementations are always defined to be
  228. zero or non-zero:
  229.  
  230.     UNIX_ATT    -- AT&T UNIX (System III, V), AIX, HPUX, ...
  231.     UNIX_BSD    -- Berkeley 4.xBSD, ULTRIX
  232.     IBM_PC_MICROSOFT-- IBM PC Microsoft version 3.x or later C
  233.                compiler
  234.     IBM_PC_TURBO    -- IBM PC Turbo C version 2.0 or later C
  235.                compiler
  236.     KCC_20        -- SRI's KCC Compiler on TOPS-20
  237.     PCC_20        -- Portable C Compiler on TOPS-20
  238.     STDC        -- Standard C (or almost Standard C) conformant
  239.                compiler and library
  240.     UNIXPC        -- UNIX PC (System V based)
  241.  
  242. Operating systems (one is always non-zero, rest are zero):
  243.  
  244.     OS_ATARI    -- Atari 520ST+ TOS (similar to MS DOS)
  245.     OS_PCDOS    -- IBM (and clones) PC DOS and MS DOS
  246.     OS_PRIMOS    -- Prime Primos
  247.     OS_RMX        -- Intel RMX 286
  248.     OS_TOPS20    -- DEC-20 TOPS-20
  249.     OS_UNIX        -- UNIX (almost any variant)
  250.     OS_VAXVMS    -- VAX VMS
  251.     OS_VMCMS    -- IBM VM/CMS with Waterloo C compiler
  252.  
  253. Device names (defined in each DVIxxx.C file) (only one is non-zero for a
  254. given output device):
  255.  
  256.     DEV_APOLLO        -- Apollo workstation display
  257.     DEV_BBNBITGRAPH        -- BBN BitGraph terminal
  258.     DEV_BROTHER_HL8        -- Brother HL8 laser printer
  259.     DEV_CANON        -- Canon LBP-8 A2 laser printer
  260.                    (original driver)
  261.     DEV_CANON_A2        -- Canon LBP-8 A2 laser printer (new
  262.                    driver)
  263.     DEV_CANON_II        -- Canon LBP-II laser printer
  264.     DEV_CUBICOMP        -- Cubicomp PC-10 color frame buffer
  265.     DEV_DOTMATRIX        -- many dot-matrix printers
  266.     DEV_DPLZR1230        -- Dataproducts LZR-1230 (HPLJ+
  267.                    emulation)
  268.     DEV_GRAYSCREEN        -- Gray-scale screen display
  269.     DEV_HPJETPLUS        -- Hewlett-Packard Laser Jet Plus
  270.                    (downloaded fonts)
  271.     DEV_IBMRT_CONSOLE    -- IBM RT display console
  272.     DEV_IMPRESS        -- imPRESS (IMAGEN laser printer)
  273.     DEV_KYOCERA        -- Kyocera F-1010 laser printer
  274.     DEV_POSTSCRIPT        -- Adobe PostScript (Apple LaserWriter
  275.                    laser printer, and many others)
  276.     DEV_SUNWINDOWS        -- SunWindows (or SunView) on Sun
  277.                    Microsystems workstations
  278.     DEV_UNIXPC        -- AT&T UNIX PC display console
  279.     DEV_VGASCREEN        -- IBM PC with VGA screen
  280.  
  281. IBM VM/CMS note:
  282.  
  283. DVI driver implementation attempts so far with the IBM and SAS/Lattice C
  284. compilers have been unsuccessful.  The port using Waterloo C was done by
  285. Shashi Sathaye <SYSSHASH@UKCC.UKY.EDU> at the Computing Center,
  286. University of Kentucky, Lexington, KY 40503.  Since no Make
  287. implementation yet exists for VM/CMS, the compilations must be done
  288. manually:
  289.  
  290.     CW dvixxx
  291.     global txtlib clib
  292.     load dvixxx
  293.  
  294. ***********************************************************************/
  295.  
  296. /**********************************************************************
  297. Define all symbols for devices, operating systems, and implementations
  298. to be explicitly 0, unless it is expected that they might be set at
  299. compile time.
  300. ***********************************************************************/
  301.  
  302. #define ALLOW_INTERRUPT    0
  303. #define ARITHRSHIFT    1 /* most C compilers use arithmetic right shift */
  304.  
  305. #define DISKFULL(fp)    (ferror(fp) && (errno == ENOSPC))
  306. #define DVIEXT        ".dvi"
  307.  
  308. #ifndef DVIFONTS            /* can be set at compile time */
  309. #define DVIFONTS    ""
  310. #endif /* DVIFONTS */
  311.  
  312. #ifndef DVIINITFILE            /* can be set at compile time */
  313. #define DVIINITFILE    "dvi.ini"
  314. #endif /* DVIINITFILE */
  315.  
  316. #ifndef DVIINPUTS            /* can be set at compile time */
  317. #define DVIINPUTS    ""
  318. #endif /* DVIINPUTS */
  319.  
  320. #define DVIPREFIX    "dvi-"
  321.  
  322. /***********************************************************************
  323. The ENV_xxx values are strings to be passed to GETENV() to obtain
  324. run-time modifications of various strings.  In the interests of
  325. consistency across all supported architectures, we keep these identical,
  326. in one letter case, and with no special characters.  Any local changes
  327. should therefore be made by compile-time definitions.
  328. ***********************************************************************/
  329.  
  330. #ifndef ENV_DVIFONTS            /* can override at compile time */
  331. #define ENV_DVIFONTS    "DVIFONTS"
  332. #endif /* ENV_DVIFONTS */
  333.  
  334. #ifndef ENV_DVIHELP            /* can override at compile time */
  335. #define ENV_DVIHELP    "DVIHELP"
  336. #endif /* ENV_DVIHELP */
  337.  
  338. #ifndef ENV_DVIINPUTS            /* can override at compile time */
  339. #define ENV_DVIINPUTS    "DVIINPUTS"
  340. #endif /* ENV_DVIINPUTS */
  341.  
  342. #ifndef ENV_FONTFMT            /* can override at compile time */
  343. #define ENV_FONTFMT    "FONTFMT"
  344. #endif /* ENV_FONTFMT */
  345.  
  346. #ifndef ENV_FONTMAGS            /* can override at compile time */
  347. #define ENV_FONTMAGS    "FONTMAGS"
  348. #endif /* ENV_FONTMAGS */
  349.  
  350. #ifndef ENV_FSMAPFILE            /* can override at compile time */
  351. #define ENV_FSMAPFILE    "FSMAPFILE"
  352. #endif /* ENV_FSMAPFILE */
  353.  
  354. #ifndef ENV_PSMAPFILE            /* can override at compile time */
  355. #define ENV_PSMAPFILE    "PSMAPFILE"
  356. #endif /* ENV_PSMAPFILE */
  357.  
  358. #ifndef ENV_SPOOLFMT            /* can override at compile time */
  359. #define ENV_SPOOLFMT    "SPOOLFMT"
  360. #endif /* ENV_SPOOLFMT */
  361.  
  362. #ifndef ENV_TEXFONTS            /* can override at compile time */
  363. #define ENV_TEXFONTS    "TEXFONTS"
  364. #endif /* ENV_TEXFONTS */
  365.  
  366. #ifndef ENV_TEXINPUTS            /* can override at compile time */
  367. #define ENV_TEXINPUTS    "TEXINPUTS"
  368. #endif /* ENV_TEXINPUTS */
  369.  
  370. #ifndef ENV_TFMFMT            /* can override at compile time */
  371. #define ENV_TFMFMT    "TFMFMT"
  372. #endif /* ENV_TFMFMT */
  373.  
  374. #define ERRSUFFIX    "err"        /* most systems use "dviname.err" */
  375. #define EXTSEPARATOR    "."        /* most systems use "file.ext" */
  376.  
  377. /***********************************************************************
  378. The following definitions work for at least PCC-20, BSD 4.2 and 4.3, and
  379. HPUX; VAX VMS has an extra level of indirection.  Check the definition
  380. of fileno(fp) in stdio.h; on PCC-20, it is
  381.     #define fileno(p) ((p)->_file)
  382. ***********************************************************************/
  383. #define FILE_CNT(fp)    (fp)->_cnt
  384. #define FILE_BASE(fp)    (fp)->_base
  385. #define FILE_PTR(fp)    (fp)->_ptr
  386.  
  387. #define FONTMAGS    ""
  388. #define FOPEN_        fopen
  389. #define FSEEK        fseek
  390. #define FTELL        ftell
  391. #define GETENV        getenv
  392. #define MALLOC(n)    malloc(n)
  393. #define MAXDRIFT    2        /* we insist that
  394.                     abs|(hh-pixel_round(h))<=MAXDRIFT| */
  395.  
  396. /***********************************************************************
  397. MAXOPENFONTS should be 7 less than the system limit on open files,
  398. allowing for files open on stdin, stdout, stderr, .dvi, .dvi-log,
  399. .dvi-xxx, and the font substitution file, plus MAXOPENFONTS font files.
  400. It may be additionally limited by the amount of memory available for
  401. buffers (e.g.  IBM PC); in such a case, the dvixxx.c files will redefine
  402. it.
  403. ***********************************************************************/
  404.  
  405. #define MAXOPENFONTS    ((OPENMAX) - 7)
  406.  
  407. #ifndef OPTION_CHAR
  408. /***********************************************************************
  409. This character prefixes command-line option switches.  The default
  410. follows UNIX traditions.  Note that if you redefine this, you should
  411. update all documentation to match.  There is no compelling reason to
  412. change this for any supported operating system, but sometimes people
  413. want to anyway.
  414. ***********************************************************************/
  415. #define OPTION_CHAR    '-'
  416. #endif /* OPTION_CHAR */
  417.  
  418. #define isoption(c)    (((c) == OPTION_CHAR) || ((c) == '@'))
  419.  
  420. #define PS_XONXOFFBUG    0
  421. #define PXLID        0
  422.  
  423. /***********************************************************************
  424. For font caching to succeed, read() must return the requested number of
  425. bytes, and preferably do this with one system call and no double
  426. buffering.
  427. ***********************************************************************/
  428.  
  429. #define READ        read
  430.  
  431. /***********************************************************************
  432. In many implementations, rewind(fp) is defined as equivalent to
  433. fseek(fp,0L,0).  In some, however (e.g.  PCC-20, and probably others
  434. based on PCC), it additionally discards input buffer contents, which may
  435. cause unnecessary I/O, and in the case of font caching, clears the
  436. cache.  Defining it in terms of fseek() should be okay, but the
  437. implementation of fseek() should be checked.
  438. ***********************************************************************/
  439.  
  440. #define REWIND(fp)    (void)FSEEK(fp,0L,0)
  441.  
  442. #ifndef SEGMEM
  443. #define SEGMEM        0        /* permit defining at compile time */
  444.                     /* for debugging SEGMEM code on UNIX */
  445. #endif /* SEGMEM */
  446.  
  447. #define SPOOLFMT    "DVISPOOL %s\n"
  448.  
  449. #define SYSPATH        ""
  450.  
  451. #define TFMEXT        ".tfm"
  452.  
  453. #define UNGETC        ungetc
  454.  
  455. /**********************************************************************/
  456. /* Clear all implementation/operating-system flags--reset later in
  457. dvixxx.c */
  458.  
  459. #define DEV_APOLLO        0
  460. #define DEV_BBNBITGRAPH        0
  461. #define    DEV_BROTHER_HL8        0
  462. #define DEV_CANON        0
  463. #define DEV_CANON_A2        0
  464.  
  465. #ifndef DEV_CANON_II    /* compile-time option for dvican.c and dvica2.c */
  466. #define DEV_CANON_II        0
  467. #endif /* DEV_CANON_II */
  468.  
  469. #define DEV_CUBICOMP        0
  470. #define DEV_DOTMATRIX        0
  471. #define DEV_DPLZR1230        0
  472. #define DEV_GRAYSCREEN        0
  473. #define DEV_HPJETPLUS        0
  474. #define DEV_KYOCERA        0
  475. #define DEV_IMPRESS        0
  476. #define DEV_POSTSCRIPT        0
  477. #define DEV_SUNWINDOWS        0
  478. #define DEV_UNIXPC        0
  479. #define DEV_VGASCREEN        0
  480. #define CACHE_FONTS        0
  481.  
  482. /***********************************************************************
  483. O/S-specific changes are relegated to separate files for each system, so
  484. that we only need to read one of them at compile time, reducing by about
  485. 800 the number of lines read for each compilation unit.
  486. ***********************************************************************/
  487.  
  488. #if    OS_ATARI
  489. #include "osatari.h"
  490. #endif /* OS_ATARI */
  491.  
  492. #if    OS_PCDOS
  493. #include "ospcdos.h"
  494. #endif /* OS_PCDOS */
  495.  
  496. #if    OS_PRIMOS
  497. #include "osprimos.h"
  498. #endif /* OS_PRIMOS */
  499.  
  500. #if    OS_RMX
  501. #include "osrmx.h"
  502. #endif /* OS_RMX */
  503.  
  504. #if    OS_TOPS20
  505. #include "ostops20.h"
  506. #endif /* OS_TOPS20 */
  507.  
  508. #if    OS_UNIX
  509. #include "osunix.h"
  510. #endif /* OS_UNIX */
  511.  
  512. #if    OS_VAXVMS
  513. #include "osvaxvms.h"
  514. #endif /* OS_VAXVMS */
  515.  
  516. #if    OS_VMCMS
  517. #include "osvmcms.h"
  518. #endif /* OS_VMCMS */
  519.  
  520. #endif /* MACHDEFS_H_DEFINED_ */
  521.